package com.cy.system;

import android.accessibilityservice.AccessibilityService;
import android.content.Context;
import android.provider.Settings;
import android.view.accessibility.AccessibilityEvent;

import com.cy.io.Log;

/**有些种类的文字节点获取不到，在有root情况下建议使用uiautomator dump命令获取布局xml代替
 * 注册
 <service
 android:name=".DetectService"
 android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">

 <intent-filter>
 <action android:name="android.accessibilityservice.AccessibilityService" />
 </intent-filter>

 <meta-data
 android:name="android.accessibilityservice"
 android:resource="@xml/detection_service_config" />
 </service>
 */
public class BaseAccessibilityService extends AccessibilityService {

    private static String mForegroundPackageName;

    public BaseAccessibilityService() {
    }

    /**
     * 监听窗口焦点,并且获取焦点窗口的包名
     *
     * @param event
     */
    @Override
    public void onAccessibilityEvent(AccessibilityEvent event) {
        Log.i(event);

    }

    @Override
    public void onInterrupt() {
    }


}